<template>
  <el-container class="main-container">
    <el-header class="header">
          <div class="header-content">
            <img src="../assets/rlzygl.png" alt="" class="logo">
            <h1 class="title">人力资源管理系统</h1>
          </div>
        </el-header>
    
    <div class="main-content-container">
      <el-aside class="aside">
        <el-menu 
          class="el-menu-vertical-demo"
          background-color="#304156"
          text-color="#fff"
          active-text-color="#00aaff"
          :default-active="activeMenu"
        >
		<el-menu-item index="" @click="activeMenu = ''">
		  <i class="el-icon-s-home"></i>
		  <span slot="title">首页</span>
		</el-menu-item>
          <el-menu-item index="attendance" @click="activeMenu = 'attendance'">
            <i class="el-icon-document"></i>
            <span slot="title">我的考勤</span>
          </el-menu-item>
          <el-menu-item index="finance" @click="activeMenu = 'finance'">
            <i class="el-icon-s-order"></i>
            <span slot="title">我的工资</span>
          </el-menu-item>
          <el-menu-item index="notice" @click="activeMenu = 'notice'">
            <i class="el-icon-s-unfold"></i>
            <span slot="title">公司公告</span>
          </el-menu-item>
        </el-menu>
      </el-aside>

      <el-main class="content-container">
        <attendance-table v-if="activeMenu === 'attendance'"></attendance-table>
        <finance-table v-else-if="activeMenu === 'finance'"></finance-table>
		<notice-table v-else-if="activeMenu === 'notice'"></notice-table>
        <template v-else>
          <div class="welcome-container">
            <h1>欢迎使用人力资源管理系统</h1>
            <p class="subtitle">请从左侧菜单中选择功能模块开始操作</p>
          </div>
        </template>
      </el-main>
    </div>
  </el-container>
</template>

<script>
import AttendanceTable from './Attendance.vue';
import FinanceTable from './Finance.vue';
import NoticeTable from './Notice.vue';

export default {
  components: {
    AttendanceTable,
    FinanceTable,
    NoticeTable // 移除重复的 NoticeTable
  },
  data() {
    return {
      activeMenu: ''
    }
  }
}
</script>

<style scoped>
/* 重置与基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 整体容器 */
.main-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 头部样式 */
.header {
  background: linear-gradient(135deg, #304156 0%, #1e2732 100%);
  color: white;
  height: 70px !important;
  display: flex;
  align-items: center;
  padding: 0 25px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-content {
  display: flex;
  align-items: center;
  width: 100%;
}

.logo-placeholder {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(to right, #409EFF, #64b0ff);
  margin-right: 15px;
  box-shadow: 0 0 12px rgba(64, 158, 255, 0.4);
}

.title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1.2px;
}

/* 主内容区 */
.main-content-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边栏 */
.aside {
  background-color: #304156;
  width: 260px;
  transition: width 0.3s;
  overflow-y: auto;
  flex-shrink: 0;
}

/* 右侧内容区 */
.content-container {
  padding: 25px;
  background-color: #f5f7fa;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 欢迎区域 */
.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.welcome-container h1 {
  font-size: 36px;
  font-weight: 600;
  color: #304156;
  margin-bottom: 15px;
}

.subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 35px;
}
.logo {
  height: 40px;
  width: 40px;
  margin-right: 15px;
  object-fit: contain;
}
</style>
